<template>

    <h1 if.bind="error" click.delegate="bind()" class="card-panel red lighten-1">Couldn't retrieve data. Wanna try
      again?</h1>
    <table class="responsive-table" if.bind="data && data.length > 0">
      <tr>
        <th>coin</th>
        <th>address</th>
        <th>amount</th>
        <th>transactionConfirmationData</th>
        <th>created</th>
      </tr>
      <tr repeat.for="payment of data">
        <td>${payment.coin}</td>
        <td><a href.bind="payment.addressInfoLink" target="_blank" class="truncate" style="max-width: 200px;">
          ${payment.address}</a></td>
        <td>${payment.amount}</td>
        <td><a href.bind="payment.transactionInfoLink" target="_blank" class="truncate" style="max-width: 200px;">
          ${payment.transactionConfirmationData}</a>
        </td>
        <td>${moment(payment.created).format("lll")}</td>
      </tr>

    </table>
    <template if.bind="!data || (data.length === 0 && currentPageNumber === 0) ">
      No Payment sent yet.
    </template>
    <button if.bind="allowNext " md-button md-waves click.delegate="currentPageNumber = currentPageNumber +1">Load
      more
    </button>
    <button  md-button md-waves click.delegate="refresh()">Refresh
    </button>


</template>
